<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateTecnicoUsinaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <p:growl id="messages" life="3000"/>

                <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
                </h:panelGroup>
                <p:panel>
                    <f:facet name="header">
                        <h:outputText value="#{bundle.LegendTecnicoUsinaTitle}"></h:outputText>
                    </f:facet>

                    <h:panelGrid columns="2">
                        <ui:remove>
                            <h:outputLabel value="#{bundle.CreateTecnicoUsinaLabel_tusId}" for="tusId" />
                            <p:inputText id="tusId" value="#{tecnicoUsinaController.selected.tusId}" title="#{bundle.CreateTecnicoUsinaTitle_tusId}" required="true" requiredMessage="#{bundle.CreateTecnicoUsinaRequiredMessage_tusId}"/>
                        </ui:remove>
                        <h:outputLabel value="#{bundle.CreateTecnicoUsinaLabel_tusUsiId}" for="tusUsiId" />
                        <h:selectOneMenu id="tusUsiId" value="#{tecnicoUsinaController.selected.tusUsiId}" title="#{bundle.CreateTecnicoUsinaTitle_tusUsiId}" required="true" requiredMessage="#{bundle.CreateTecnicoUsinaRequiredMessage_tusUsiId}">
                            <f:selectItems value="#{usinaController.itemsAvailableSelectOne}"/>
                            <p:focus for="tusUsiId"/>
                        </h:selectOneMenu>
                        <h:outputLabel value="#{bundle.CreateTecnicoUsinaLabel_tusTecId}" for="tusTecId" />
                        <h:selectOneMenu id="tusTecId" value="#{tecnicoUsinaController.selected.tusTecId}" title="#{bundle.CreateTecnicoUsinaTitle_tusTecId}" required="true" requiredMessage="#{bundle.CreateTecnicoUsinaRequiredMessage_tusTecId}">
                            <f:selectItems value="#{tecnicoController.itemsAvailableSelectOne}"/>
                        </h:selectOneMenu>
                    </h:panelGrid>
                    <br/>
                    <p:commandButton ajax="false" icon="ui-icon-disk" action="#{tecnicoUsinaController.create}" value="#{bundle.CreateTecnicoUsinaSaveLink}" /> &nbsp;                    
                    <p:commandButton ajax="false" action="#{tecnicoUsinaController.prepareList}" value="#{bundle.CreateTecnicoUsinaShowAllLink}" immediate="true"/>

                </p:panel>

            </h:form>
            <br/>            
            <ui:include src="Lista.xhtml" />
        </ui:define>
    </ui:composition>

</html>
